package entity;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * 订单实体类
 */
public class Order implements Serializable {
    // 序列化版本号
    private static final long serialVersionUID = 1L;
    // 订单id
    private String orderId;
    // 用户id
    private Integer userId;
    // 地址id
    private Integer addId;
    // 实付金额
    private Double payment;
    // 支付类型
    private Integer paymentType;
    // 邮费
    private Double postFee;
    // 订单状态
    private Integer status;
    // 创建时间
    private java.sql.Timestamp createTime;
    // 更新时间
    private java.sql.Timestamp updateTime;
    // 付款时间
    private java.sql.Timestamp paymentTime;
    // 发货时间
    private java.sql.Timestamp consignTime;
    // 交易完成时间
    private java.sql.Timestamp endTime;
    // 交易关闭时间
    private java.sql.Timestamp closeTime;
    // 物流名称
    private String shippingName;
    // 物流单号
    private String shippingCode;
    // 用户留言
    private String buyerMessage;
    // 买家昵称
    private String buyerNick;
    // 买家是否已经评价
    private Integer buyerRate;

    public Order() {
    }

    public Order(String orderId, Integer userId, Integer addId, Double payment, Integer paymentType, Double postFee, Integer status, Timestamp createTime, Timestamp updateTime, Timestamp paymentTime, Timestamp consignTime, Timestamp endTime, Timestamp closeTime, String shippingName, String shippingCode, String buyerMessage, String buyerNick, Integer buyerRate) {
        this.orderId = orderId;
        this.userId = userId;
        this.addId = addId;
        this.payment = payment;
        this.paymentType = paymentType;
        this.postFee = postFee;
        this.status = status;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.paymentTime = paymentTime;
        this.consignTime = consignTime;
        this.endTime = endTime;
        this.closeTime = closeTime;
        this.shippingName = shippingName;
        this.shippingCode = shippingCode;
        this.buyerMessage = buyerMessage;
        this.buyerNick = buyerNick;
        this.buyerRate = buyerRate;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getAddId() {
        return addId;
    }

    public void setAddId(Integer addId) {
        this.addId = addId;
    }

    public Double getPayment() {
        return payment;
    }

    public void setPayment(Double payment) {
        this.payment = payment;
    }

    public Integer getPaymentType() {
        return paymentType;
    }

    public void setPaymentType(Integer paymentType) {
        this.paymentType = paymentType;
    }

    public Double getPostFee() {
        return postFee;
    }

    public void setPostFee(Double postFee) {
        this.postFee = postFee;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    public Timestamp getPaymentTime() {
        return paymentTime;
    }

    public void setPaymentTime(Timestamp paymentTime) {
        this.paymentTime = paymentTime;
    }

    public Timestamp getConsignTime() {
        return consignTime;
    }

    public void setConsignTime(Timestamp consignTime) {
        this.consignTime = consignTime;
    }

    public Timestamp getEndTime() {
        return endTime;
    }

    public void setEndTime(Timestamp endTime) {
        this.endTime = endTime;
    }

    public Timestamp getCloseTime() {
        return closeTime;
    }

    public void setCloseTime(Timestamp closeTime) {
        this.closeTime = closeTime;
    }

    public String getShippingName() {
        return shippingName;
    }

    public void setShippingName(String shippingName) {
        this.shippingName = shippingName;
    }

    public String getShippingCode() {
        return shippingCode;
    }

    public void setShippingCode(String shippingCode) {
        this.shippingCode = shippingCode;
    }

    public String getBuyerMessage() {
        return buyerMessage;
    }

    public void setBuyerMessage(String buyerMessage) {
        this.buyerMessage = buyerMessage;
    }

    public String getBuyerNick() {
        return buyerNick;
    }

    public void setBuyerNick(String buyerNick) {
        this.buyerNick = buyerNick;
    }

    public Integer getBuyerRate() {
        return buyerRate;
    }

    public void setBuyerRate(Integer buyerRate) {
        this.buyerRate = buyerRate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Order order = (Order) o;
        return Objects.equals(orderId, order.orderId) && Objects.equals(userId, order.userId) && Objects.equals(addId, order.addId) && Objects.equals(payment, order.payment) && Objects.equals(paymentType, order.paymentType) && Objects.equals(postFee, order.postFee) && Objects.equals(status, order.status) && Objects.equals(createTime, order.createTime) && Objects.equals(updateTime, order.updateTime) && Objects.equals(paymentTime, order.paymentTime) && Objects.equals(consignTime, order.consignTime) && Objects.equals(endTime, order.endTime) && Objects.equals(closeTime, order.closeTime) && Objects.equals(shippingName, order.shippingName) && Objects.equals(shippingCode, order.shippingCode) && Objects.equals(buyerMessage, order.buyerMessage) && Objects.equals(buyerNick, order.buyerNick) && Objects.equals(buyerRate, order.buyerRate);
    }

    @Override
    public int hashCode() {
        return Objects.hash(orderId, userId, addId, payment, paymentType, postFee, status, createTime, updateTime, paymentTime, consignTime, endTime, closeTime, shippingName, shippingCode, buyerMessage, buyerNick, buyerRate);
    }

    @Override
    public String toString() {
        return "Order{" +
                "orderId=" + orderId +
                ", userId=" + userId +
                ", addId=" + addId +
                ", payment=" + payment +
                ", paymentType=" + paymentType +
                ", postFee=" + postFee +
                ", status=" + status +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", paymentTime=" + paymentTime +
                ", consignTime=" + consignTime +
                ", endTime=" + endTime +
                ", closeTime=" + closeTime +
                ", shippingName='" + shippingName + '\'' +
                ", shippingCode='" + shippingCode + '\'' +
                ", buyerMessage='" + buyerMessage + '\'' +
                ", buyerNick='" + buyerNick + '\'' +
                ", buyerRate=" + buyerRate +
                '}';
    }
}
